#!/usr/bin/env python

from xml.dom.minidom import parse
import xml.dom.minidom

domTree = xml.dom.minidom.parse("movie.xml")
collection = domTree.documentElement

if collection.hasAttribute("shelf"):
    print "Root elements: %s " % collection.getAttribute("shelf")

movies = collection.getElementsByTagName("movie")

for movie in movies:
    print "***** Movie ****"
    if movie.hasAttribute("title"):
        print "Title :%s" % movie.getAttribute("title")

    
